package entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;

@Entity
@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)
public class Lead implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long custId;
    private Employee employee;
    private String email;
    private String firstName;
    private String lastName;
    private String company;
    private String title;
    private String status;
    private Integer phone;
    @OneToOne(cascade = {CascadeType.PERSIST}, fetch=FetchType.EAGER)
    private Address companyAddress;
    private Double revenue;
    private String description;
    private Integer numEmployee;
    private String industry;
    @OneToMany(cascade = {CascadeType.PERSIST}, fetch=FetchType.EAGER)
    private List<Inquiry> inquiries = new ArrayList<Inquiry>();

    public Lead() {
    }

    public Lead(Employee employee, String email, String firstName, String lastName, String company, String title, String status, Integer phone, Address companyAddress, Double revenue, String description, Integer numEmployee, String industry) {
        this.employee = employee;
        this.email = email;
        this.firstName = firstName;
        this.lastName = lastName;
        this.company = company;
        this.title = title;
        this.status = status;
        this.phone = phone;
        this.companyAddress = companyAddress;        
        this.revenue = revenue;
        this.description = description;
        this.numEmployee = numEmployee;
        this.industry = industry;

    }

    public Long getId() {
        return getCustId();
    }

    public void setId(Long custId) {
        this.setCustId(custId);
    }

    /**
     * @return the custId
     */
    public Long getCustId() {
        return custId;
    }

    /**
     * @param custId the custId to set
     */
    public void setCustId(Long custId) {
        this.custId = custId;
    }

    /**
     * @return the email
     */
    public String getEmail() {
        return email;
    }

    /**
     * @param email the email to set
     */
    public void setEmail(String email) {
        this.email = email;
    }

    /**
     * @return the firstName
     */
    public String getFirstName() {
        return firstName;
    }

    /**
     * @param firstName the firstName to set
     */
    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    /**
     * @return the lastName
     */
    public String getLastName() {
        return lastName;
    }

    /**
     * @param lastName the lastName to set
     */
    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    /**
     * @return the company
     */
    public String getCompany() {
        return company;
    }

    /**
     * @param company the company to set
     */
    public void setCompany(String company) {
        this.company = company;
    }

    /**
     * @return the title
     */
    public String getTitle() {
        return title;
    }

    /**
     * @param title the title to set
     */
    public void setTitle(String title) {
        this.title = title;
    }

    /**
     * @return the status
     */
    public String getStatus() {
        return status;
    }

    /**
     * @param status the status to set
     */
    public void setStatus(String status) {
        this.status = status;
    }

    /**
     * @return the phone
     */
    public Integer getPhone() {
        return phone;
    }

    /**
     * @param phone the phone to set
     */
    public void setPhone(Integer phone) {
        this.phone = phone;
    }

    /**
     * @return the companyAddress
     */
    
    public Address getCompanyAddress() {
        return companyAddress;
    }

    /**
     * @param companyAddress the companyAddress to set
     */
    public void setCompanyAddress(Address companyAddress) {
        this.companyAddress = companyAddress;
    }

    /**
     * @return the revenue
     */
    public Double getRevenue() {
        return revenue;
    }

    /**
     * @param revenue the revenue to set
     */
    public void setRevenue(Double revenue) {
        this.revenue = revenue;
    }

    /**
     * @return the numEmployee
     */
    public Integer getNumEmployee() {
        return numEmployee;
    }

    /**
     * @param numEmployee the numEmployee to set
     */
    public void setNumEmployee(Integer numEmployee) {
        this.numEmployee = numEmployee;
    }

    /**
     * @return the industry
     */
    public String getIndustry() {
        return industry;
    }

    /**
     * @param industry the industry to set
     */
    public void setIndustry(String industry) {
        this.industry = industry;
    }

    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }

    /**
     * @param description the description to set
     */
    public void setDescription(String description) {
        this.description = description;
    }

    /**
     * @return the employee
     */
       
   @OneToOne(cascade = {CascadeType.PERSIST})
    public Employee getEmployee() {
        return employee;
    }

    /**
     * @param employee the employee to set
     */
    public void setEmployee(Employee employee) {
        this.employee = employee;
    }

    /**
     * @return the inquiries
     */
    public List<Inquiry> getInquiries() {
        return inquiries;
    }

    /**
     * @param inquiries the inquiries to set
     */
    public void setInquiries(List<Inquiry> inquiries) {
        this.inquiries = inquiries;
    }
}
